var app = getApp()
Page({
data:{
  onLoad: function () { },
  sea:getApp().as
},
  qw() {
    var that=this
    wx.request({
      url: 'http://139.199.105.136/lovewall/show', //仅为示例，并非真实的接口地址
      data: {},

      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
       
        var data = res.data;
        var sea = new Array();
        var nu = 0;
        for (var i in data) {
          if (data[i].message.indexOf(gjz) >= 0) {
            sea[nu] = data[i];
            nu++;
          }
          console.log(sea)
        }
        this.setData({
          sea: sea
        })

      },
      fail: function (err) {
        console.log(err)
      }
    })
    },
onLoad: function (options) {
  var that = this
  wx.request({
    url: 'http://139.199.105.136/lovewall/show', //仅为示例，并非真实的接口地址
    data: {},

    header: {
      'content-type': 'application/json'
    },
    success: function (res) {
      var data = res.data;
      var numb = 1;
      for (var i in data) {
        if (data[numb] != null) { numb++; }

      }
      var dat = new Array();

      var len = (numb - 2);

      for (var nu = 0; nu < len; nu++) {

        dat[nu] = data[len - nu];

        console.log(dat)

      }

      
      var sea = new Array();
      var nu = 0;
      for (var i in dat) {
        if (dat[i].message.indexOf(gjz) >= 0||dat[i].name.indexOf(gjz)>=0) {
          sea[nu] = dat[i];
          nu++;
        }
        console.log(sea)
      }
      that.setData({
        sea: sea
      });

    },
    fail: function (err) {
      console.log(err)
    }
  })
  console.log('onLoad')
  var gjz=options.gjz;
  console.log(gjz)
  /*this.setData({
  sea:options.sea
  });*/
  
      
      

},
  showDetail(event) {
    wx.navigateTo({
      url: '../entry/entry?id=' + event.currentTarget.id,
    });
  },
  onHide: function () {
  }
})